export const default_columns = [
  {
    title: '样品编号',
    dataIndex: 'sampleID',
    key: 'sampleID',
    fixed: 'left',
    width: 70,
  },
  {
    title: '分析日期',
    dataIndex: 'analysisTime',
    key: 'analysisTime',
    fixed: 'left',
    width: 75,
  },
  {
    title: '样品名称',
    dataIndex: 'sampleName',
    key: 'sampleName',
    fixed: 'left',
    width: 150,
  },
  {
    title: '批号',
    dataIndex: 'batchID',
    key: 'batchID',
    fixed: 'left',
    width: 110,
  },
  {
    title: '取样时间',
    dataIndex: 'samplingTime',
    key: 'samplingTime',
    fixed: 'left',
    width: 140,
  },
  {
    title: '6元素表金属杂质ppbw',
    dataIndex: '6_ppbw',
    key: '6_ppbw',
    width: 70,
    customRender: (text: any) => saveThree(text.text),
  },
  {
    title: '10元素表金属杂质ppbw',
    dataIndex: '10_ppbw',
    key: '10_ppbw',
    width: 70,

    customRender: (text: any) => saveThree(text.text),
  },
  {
    title: '12元素表金属杂质ppbw',
    dataIndex: '12_ppbw',
    key: '12_ppbw',
    width: 70,

    customRender: (text: any) => saveThree(text.text),
  },
  {
    title: '13元素表金属杂质ppbw',
    dataIndex: '13_ppbw',
    key: '13_ppbw',
    width: 70,
    customRender: (text: any) => saveThree(text.text),
  },
  {
    title: '15元素表金属杂质ppbw',
    dataIndex: '15_ppbw',
    key: '15_ppbw',
    width: 70,
    customRender: (text: any) => saveThree(text.text),
  },
  {
    title: '表金属杂质元素(ppbw)',
    // dataIndex: 'name7',
    // key: 'name7',
    children: [
      {
        title: 'Na',
        dataIndex: 'Na',
        key: 'Na',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Mg',
        dataIndex: 'Mg',
        key: 'Mg',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Al',
        dataIndex: 'Al',
        key: 'Al',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'K',
        dataIndex: 'K',
        key: 'K',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Ca',
        dataIndex: 'Ca',
        key: 'Ca',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Cr',
        dataIndex: 'Cr',
        key: 'Cr',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Fe',
        dataIndex: 'Fe',
        key: 'Fe',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Ni',
        dataIndex: 'Ni',
        key: 'Ni',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Cu',
        dataIndex: 'Cu',
        width: 70,
        key: 'Cu',
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Zn',
        dataIndex: 'Zn',
        key: 'Zn',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Co',
        dataIndex: 'Co',
        width: 70,
        key: 'Co',
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Mn',
        width: 70,
        dataIndex: 'Mn',
        key: 'Mn',
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'W',
        dataIndex: 'W',
        width: 70,
        key: 'W',
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Ti',
        dataIndex: 'Ti',
        width: 70,
        key: 'Ti',
        customRender: (text: any) => saveThree(text.text),
      },
      {
        title: 'Mo',
        dataIndex: 'Mo',
        key: 'Mo',
        width: 70,
        customRender: (text: any) => saveThree(text.text),
      },
    ],
  },
  {
    title: '计算值',
    dataIndex: 'value',
    width: 70,
    key: 'value',
    customRender: (text: any) => saveThree(text.text),
  },
  {
    title: '样品重量',
    dataIndex: 'sampleWeight',
    width: 70,
    key: 'sampleWeight',
    customRender: (text: any) => saveThree(text.text),
  },
  {
    title: '酸液重量',
    dataIndex: 'acidWeight',
    width: 70,
    key: 'acidWeight',
    customRender: (text: any) => saveThree(text.text),
  },
];
function saveThree(value: string) {
  const re = /^(\-?\d+\.\d{1,3})\d*$/.exec(value);
  if (re) {
    return re[1];
  }
  return value;
}
